package com.ruoyi.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.entity.AccountLog;
import com.ruoyi.service.AccountLogServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;

/**

 
 */
@RestController("账户交易记录")
@RequestMapping("/business/account-log")
public class AccountLogController extends BaseController {
    @Autowired
    private AccountLogServiceImpl service;

    @RequestMapping(value = "/list")
    public Object selectPage(Page page, @RequestParam Map<String, Object> param) {
        service.selectPage(page, param);
        return page;
    }

    @RequestMapping(value = "/getById")
    public Object getById(Long id) {
        return service.getById(id);
    }

    @RequestMapping(value = "/doSave")
    @Transactional(rollbackFor = Exception.class)
    public Object doSave(@RequestBody AccountLog accountLog) {
        service.doSave(accountLog);
        return "";
    }

    @RequestMapping(value = "/deleteById")
    public Object deleteById(Long id) {
        service.deleteById(id);
        return "";
    }
}
